'use strict';
const sessionAuth = require('./policies/sessionAuth');
const source = require('./policies/source');
const permission = require('./policies/permission');

module.exports = (options, app) => {
  return async (ctx, next) => {
    await sessionAuth(options, app)(ctx, next);
    await source(options, app)(ctx, next);
    await permission(options, app)(ctx, next);
    await next();
  };
};
